﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>

<form id="form1">
    <div class='myzh_right_content fr'>
        <p class='right_head_title'><span class="span1">我的 ></span> 操作</p>
        <div class="recharge-content">
            <input type="hidden" id="user_id" name="user_id" value="${data.user_id}"/>
            <div class="mt-10">
                <span class="fl mt-3 w-120">用户编号：</span>
                ${data.user_id}
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">昵称：</span>
                ${data.nick_name}
                <div class="cl"></div>
            </div>

            <div class="mt-10">
                <span class="fl mt-3 w-120">linkedin：</span>
                <a href="${data.linkedin}" target="_blank">
                    ${data.linkedin}
                </a>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">简历：</span>
                <a href="${imgurl}${data.resume}" target="_blank">
                   ${imgurl}${data.resume}
                </a>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">自我介绍：</span>
                ${data.introduction}
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">好评数：</span>
                ${data.good_count}
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">关注数：</span>
                ${data.follow_count}
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">业务人才审核状态：</span>
                <c:choose>
                    <c:when test="${data.is_business_status==1}">
                        审核通过
                    </c:when>
                    <c:when test="${data.is_business_status==2}">
                        待审核
                    </c:when>
                    <c:when test="${data.is_business_status==3}">
                        审核拒绝
                    </c:when>
                </c:choose>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">代码人才审核状态：</span>
                <c:choose>
                    <c:when test="${data.is_code_status==1}">
                        审核通过
                    </c:when>
                    <c:when test="${data.is_code_status==2}">
                        待审核
                    </c:when>
                    <c:when test="${data.is_code_status==3}">
                        审核拒绝
                    </c:when>
                </c:choose>
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">代码分析数：</span>
                ${data.code_counter}
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">业务分析数：</span>
                ${data.business_counter}
                <div class="cl"></div>
            </div>

            <div class="mt-10">
                <span class="fl mt-3 w-120">业务审核拒绝原因：</span>
                <input type="text" class="txt txt-1 fl w-280" id="business_status_refuse" name="business_status_refuse"
                       value="${data.business_status_refuse}">
                <div class="cl"></div>
            </div>
            <div class="mt-10">
                <span class="fl mt-3 w-120">代码审核拒绝原因：</span>
                <input type="text" class="txt txt-1 fl w-280" id="code_status_refuse" name="code_status_refuse"
                       value="${data.code_status_refuse}">
                <div class="cl"></div>
            </div>
            <div class="mt-30 ml-10">
                <c:if test="${data.is_business_status==2}">
                    <c:if test="${data.is_business_status!=1}">
                        <input type="button" class="btn btn-1 fl w-100" value="业务审核通过" onclick="add('business_status',1)">
                    </c:if>
                    <c:if test="${data.is_business_status!=3}">
                        <input type="button" class="btn btn-2 fl w-100 ml-20" value="业务审核拒绝"
                           onclick="add('business_status',3)">
                    </c:if>
                </c:if>
                <c:if test="${data.is_code_status==2}">
                    <c:if test="${data.is_code_status!=1}">
                        <input type="button" class="btn btn-1 fl w-100 ml-20" value="代码审核通过" onclick="add('code_status',1)">
                    </c:if>
                    <c:if test="${data.is_code_status!=3}">
                        <input type="button" class="btn btn-2 fl w-100 ml-20" value="代码审核拒绝" onclick="add('code_status',3)">
                    </c:if>
                </c:if>
                <input type="button" class="btn btn-2 fl w-100 ml-20" value="返回"
                       onclick="window.location='${basePath}/t_user_elites/list'">
            </div>
        </div>
    </div>
</form>
<div class='clear'></div>
<script type="text/javascript">
    function add(type_id, status) {
        var is_business_status;
        var business_status_refuse;
        var is_code_status;
        var code_status_refuse;
        if (type_id == "business_status") {
            if (status == 3 && $("#business_status_refuse").val() == "") {
                alert("请输入拒绝原因");
                return;
            }
            is_business_status = status;
            business_status_refuse = $("#business_status_refuse").val();
        }
        else if (type_id == "code_status") {
            if (status == 3 && $("#code_status_refuse").val() == "") {
                alert("请输入拒绝原因");
                return;
            }
            is_code_status = status;
            code_status_refuse = $("#code_status_refuse").val();
        }
        $.post("${basePath}/ajax/t_user_elites/add",
            {
                user_id: $("#user_id").val(),
                is_business_status: is_business_status, business_status_refuse: business_status_refuse,
                is_code_status: is_code_status, code_status_refuse: code_status_refuse
            }, function (d) {
                if (d.code == 1) {
                    alert("操作成功");
                    window.location = "${basePath}/t_user_elites/list";
                    return;
                }
                alert("操作失败");
            });
    }
</script>


